// 订单状态枚举
export enum OrderStatus {
  PENDING = 'pending',    // 待付款
  PAID = 'paid',         // 已付款
  SHIPPED = 'shipped',   // 已发货
  COMPLETED = 'completed', // 已完成
  CANCELLED = 'cancelled' // 已取消
}

// 订单状态中文映射
export const OrderStatusText = {
  [OrderStatus.PENDING]: '待付款',
  [OrderStatus.PAID]: '已付款',
  [OrderStatus.SHIPPED]: '已发货',
  [OrderStatus.COMPLETED]: '已完成',
  [OrderStatus.CANCELLED]: '已取消'
};

// 订单商品项
export interface OrderItem {
  id: string;
  name: string;
  price: number;
  quantity: number;
  image?: string;
}

// 收货地址
export interface Address {
  name: string;
  phone: string;
  province: string;
  city: string;
  district: string;
  detail: string;
}

// 订单信息
export interface Order {
  id: string;
  createTime: string;
  payTime?: string;  // 支付时间，可选字段
  totalAmount: number;
  status: OrderStatus;
  items: OrderItem[];
  address: Address;
  paymentMethod?: string;  // 支付方式，可选字段
  userId: string;  // 用户ID
} 